Assessment of episodes of drug use and psychosocial stress is complicated by the fact that each is often transient and difficult to recall accurately. Assessment of their causal connections with one another, and of their genetic and environmental determinants, is complicated by the complexity of the causal connections and by the elusive nature of what constitutes the environment. In this project, we are assessing drug use and psychosocial stress in near-real time through ecological momentary assessment (EMA), in which participants use handheld electronic diaries to record events as they occur and to report recent or ongoing events in response to randomly timed prompts throughout the day. We are also maintaining real-time records of where the reported events occur by collecting GPS data to track their whereabouts with a spatial resolution of several meters. We use these data collectively in a method we are calling geographical momentary assessment (GMA). Our goal with GMA has little to do with knowing the specific Baltimore locations where drug-related behaviors occur, and everything to do with gaining generalizable knowledge about how activity spaces (the spaces in which daily activities occur) are associated with such behaviors and their precipitants. We are currently analyzing GMA data from 190 opioid/cocaine users in opioid-agonist maintenance. An innovation that we introduced in our project was to investigate stressful events in patients with opioid use disorder by asking them to report the events in real time on smartphones. Knowing how stress manifests in the lives of people with substance-use disorders could help inform mobile just in time treatment. The objective was to examine discrete episodes of stress, as distinct from the fluctuations in background stress assessed in most EMA studies. Participants reported the severity of stress and craving and the context of the report (location, activities, companions) in each stress event entry. Craving for opioids increased with stress severity. Stress events tended to occur in social company (with acquaintances, friends, or on the phone) rather than with family and in places with more overall activity and more likelihood of unexpected experiences. Being on the internet was slightly protective. Our prior finding that being at the workplace protects against background stress in our participants was partly supported in these stressful-event data. The contexts of specific stressful events differ from those we have seen in prior studies of ongoing background stress. However, both are associated with drug craving. EMA reports of specific events usually focus more on antecedents and concomitants than on aftermaths. We examined mental state reported in thrice daily randomly prompted entries both before and after discrete episodes of stressful events (SE) and lapses to drug use (DUs). In RPs, participants rated their stress, opioid craving, cocaine craving, and moods. Randomly prompted (RP) entries within 5 hrs of an event were analyzed and compared to other RPs. Stress, negative mood, and craving were generally higher before and after DUs and SEs compared to background levels in participants with at least one DU (n=149) or SE (n=158). Before DUs, there were increases in negative mood, opioid craving, and cocaine craving, but not background stress. Before SEs, there were increases in background stress, opioid craving, and cocaine craving, but not negative mood. These changes were more variable after events than before. Neither DUs nor SEs were significantly related to positive mood. Stress increased before stressful-event entries, but was less evident before drug use. Craving increased in the hours before drug use and stressful eventsand remained elevated in the hours after either event. These results suggest a stronger link between drug use and craving than between drug use and stress. Lapses to drug use did not improve mood or reduce stress, at least not at our 1-hr-bin time resolution, suggesting that if such benefits exist, they are brief. Risk factors for craving and use include stress and drug-related cues. Stress and cues have additive or more-than-additive effects on drug seeking in laboratory animals, but, surprisingly, seem to compete with one another (i.e., exert less-than-additive effects) in human laboratory studies of craving. We sought heretofore elusive evidence that human drug users could show additive (or more-than-additive) effects of stress and cues on craving, using EMA. In RPs, participants reported the severity of stress and craving and whether they had seen or been offered opioids, cocaine, cannabis, methamphetamine, alcohol, or tobacco. In random effects models controlling for between-person differences, we tested effects of momentary drug-cue exposure and stress (and their interaction) on momentary ratings of cocaine and heroin craving. For cocaine craving, the Stress x Cue interaction term had a positive mean effect across participants, denoting a more-than-additive effect. For heroin, the mean was not significantly greater than 0, but the confidence interval was predominantly positive, suggesting at least an additive effect. Heterogeneity was substantial; qualitatively, the Stress x Cue effect appeared additive for most participants, more than additive for a sizeable minority, and competitive in very few. In the field, unlike in human laboratory studies to date, craving for cocaine and heroin is greater with the combination of drug cues and stress than with either alone. For a substantial minority of users, the combined effect may be more than additive. Responses to stress and drug craving differ between men and women. Differences in the momentary experience of stress in relation to craving are less well-understood. We used EMA data to examine sex differences in two areas: 1) causes and contexts associated with stress, and 2) the extent to which stress and drug cues are associated with craving. For these analyses, we analyzed the entries initiated when participants felt more stressed than usual (stress event) and randomly prompted entries. The causes reported for stress events did not differ significantly by sex. Women reported arguing and being in a store more often during stress events, and men reported working more often during stress events, compared to base rates (assessed via RPs). Women showed a greater increase in opioid craving relative to men in the presence of both stress and cues compared to either alone. Men showed a greater increase in cocaine craving relative to women when stress was present. The effect of cues on cocaine craving was greater when stress was also present (more apparent in men). EMA methods provide evidence based on real-time activities and moods that opioid-dependent men and women experience similar contexts and causes for stress, with different responses. One of our other mHealth activities is evaluation of the effects of drug use on circadian rhythm and sleep. We are currently analyzing data from a mobile device that monitors light exposure and activity to assess circadian disruption and its relation to treatment outcome. We are also conducting a study of sleep in opioid-maintained outpatients with and without chronic pain.